#include<stdio.h>
#include<unistd.h>
#include <stdlib.h>


#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>



void* my_thread(void  *arg)
{
    int i;
   while(1)
    {
        printf("Wait %d ...\n", i);
        system("echo 333");
        sleep(1);
    }

    //execl("/sbin/ifconfig", "ifconfig", arg->name, NULL);
}
void* my_thread2(void *arg)
{
    int i;
    while(1)
    {
        printf("Wait %d ...\n", i);
        system("echo 222");
        sleep(1);
    }

    //execl("/sbin/ifconfig", "ifconfig", arg->name, NULL);
}

int main(int argc, char **argv)
{
    pthread_t tid,tid2;
    int ret;


    ret = pthread_create(&tid, NULL, my_thread, 0);
    if(ret != 0)
    {
        printf("Thread Create Error\n");
        exit(0);
    }
    
    ret = pthread_create(&tid2, NULL, my_thread2, 0);
    if(ret != 0)
    {
        printf("Thread Create Error\n");
        exit(0);
    }

    while(1)
    {
        sleep(5);
        system("echo 1111");
    }

    //pthread_join(tid, NULL);
    printf("Main Ends\n");
}